package ssrw;
/*
 * JAreaMonitor.fx
 *
 * Created on 2010-05-30, 10:59:08
 */

import javafx.scene.CustomNode;
import javafx.scene.Node;
import javafx.scene.paint.Color;
import javafx.scene.text.Text;
import javafx.scene.text.TextAlignment;
import javafx.scene.text.Font;

/**
 * @author Andrzej
 */

public class TextAreaMonitor extends CustomNode {

    public-init var width = 300;
    public-init var height = 200;
    public var x : Number;
    public var y : Number;
    public var wrapWidth : Number;



    public var textField = Text{
                layoutX: bind x;
                layoutY: bind y;
                font: Font {
                    name: "Times New Roman"
                    size: 20
                }

                fill: Color.WHITE
                wrappingWidth: bind wrapWidth
                content: ""
                textAlignment: TextAlignment.CENTER
    }



    override public function create () : Node {
        textField;
    }


    public function updateTextArea (pwr: Number) : Void {
  //      var rand = Math.random();
    
        if (pwr > 0)
            textField.content = "Power DOWN"
        else
            textField.content = "Power UP";
    }
    
}
